<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlterCafesDropCompanyColumns extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('cafes', function (Blueprint $table) {
            //
            $table->dropColumn(['name','roaster','website','description','added_by','parent_id']);
            $table->integer('company_id')->nullable(false)->unsigned()->default(0)->comment('公司id');
            $table->integer('city_id')->nullable(false)->default(0)->unsigned()->after('location_name')->comment('城市id');
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('cafes', function (Blueprint $table) {
            //
        });
    }
}
